﻿using SqlSugar;

namespace MyModels.Models
{
    /// <summary>
    /// 部门表
    /// </summary>
    public class Department : RootEntityTKey<long>
    {

        /// <summary>
        /// 父节点
        /// </summary>
        public long Pid { get; set; }
        /// <summary>
        /// 父节点集合
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<long> PidArr { get; set; }

        /// <summary>
        /// 部门关系编码
        /// </summary>
        public string CodeRelationship { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        public string? Leader { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int OrderSort { get; set; } = 0;

        /// <summary>
        /// 部门状态
        /// </summary>
        public bool Status { get; set; } = false;

        /// <summary>
        /// 是否有子节点
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public bool HasChildren { get; set; } = true;
    }
}
